package org.example.tree;

/**
 * @author liyishan
 * @date 2024/2/22 10:15
 * @apiNote
 */

public class Test00104MaxDepth {

    public int maxDepth(TreeNode root) {
        if(root == null){
            return 0;
        }
        return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
    }
}
